package com.examples.springboot.jpa.pojos;

import com.examples.springboot.jpa.utils.Utility;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Builder
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ClimberVo {
  private String id;
  private String name;
  private MountVo mount;
  private ClimberPhoneNumberVo phoneNumber;

  public ClimberVo(ClimberDto climberDto) {
    this(climberDto.getId(),
        climberDto.getName(),
        Utility.isEmpty(climberDto.getClimbedMounts())?null:new MountVo(climberDto.getClimbedMounts().iterator().next()),
        Utility.isEmpty(climberDto.getPhoneNumbers())?null:new ClimberPhoneNumberVo(climberDto.getPhoneNumbers().iterator().next()));
  }
  
  
}
